<?php

if(!isset($_SESSION['Admin']) && !isset($_SESSION['Eleve']))
	header('Location: login.php');

if(isset($_SESSION['Admin']) && $_SESSION['Admin']->idRefCollege() != NULL && basename($_SERVER['PHP_SELF']) != "resultats.php"  && basename($_SERVER['PHP_SELF']) != "impr_rapport_eleve.php" && basename($_SERVER['PHP_SELF']) != "impr_rapport_classe.php")
	header('Location: resultats.php');
	
if(isset($_SESSION['Admin']) && basename($_SERVER['PHP_SELF']) == "index-2.php")
	header('Location: index.php');

if(isset($_SESSION['Admin']) && basename($_SERVER['PHP_SELF']) == "test.php")
	header('Location: index.php');
	
if(isset($_SESSION['Admin']) && basename($_SERVER['PHP_SELF']) == "go.php")
	header('Location: index.php');
	
if(isset($_SESSION['Eleve']) && basename($_SERVER['PHP_SELF']) != "go.php" && basename($_SERVER['PHP_SELF']) != "test.php" && basename($_SERVER['PHP_SELF']) != "index-2.php")
	header('Location: index-2.php');

?>